build(samples): Remove outputs.upToDateWhen { false } from systemTest tasks#5522
Open
runningcode wants to merge 2 commits into
Open
build(samples): Remove outputs.upToDateWhen { false } from systemTest tasks#5522runningcode wants to merge 2 commits into
runningcode wants to merge 2 commits into
Conversation
… tasks The systemTest tasks in the sample modules forced Gradle to always treat their outputs as out of date, disabling up-to-date checks and build cache reuse. Removing this lets Gradle rely on its normal input/output tracking for the Test tasks. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
📲 Install BuildsAndroid
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 44084fa. Configure here.
adinauer
approved these changes
Jun 10, 2026
adinauer
left a comment
Member
There was a problem hiding this comment.
Nice work! Thanks! Approving so you can merge once the comment is addressed.
The system tests launch the packaged sample (war/shadowJar/bootJar) from
build/libs as a separate process, so the archive is a real input to the
systemTest task even though it is not on the test classpath. Without it,
removing outputs.upToDateWhen { false } would let Gradle mark systemTest
up-to-date while a separate jar build refreshed the artifact, skipping
verification against the rebuilt sample.
Move that wiring into a single io.sentry.systemtest convention plugin in
build-logic instead of repeating it in every sample build file. The
plugin auto-detects the packaging task (war, else shadowJar, else
bootJar), mirroring the selection in test/system-test-runner.py, and
declares its archive as an input and dependency. Each sample just
applies the plugin.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
b038dc1 to
9724cf1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

📜 Description
Removes
outputs.upToDateWhen { false }from thesystemTesttasks in thesentry-samples/*modules, and replaces it with proper Gradle input tracking via a newio.sentry.systemtestconvention plugin.The system tests launch the packaged sample app (
shadowJar/bootJar/war) frombuild/libsas a separate process — it is not on the test classpath. With onlyoutputs.upToDateWhen { false }removed, Gradle would compute up-to-date purely from the test classes and runtime classpath, so a separate jar build could refresh the artifact whilesystemTestwas skipped, meaning the assertions never ran against the rebuilt sample.Rather than repeat the input wiring in all 22 sample build files, it lives in one
build-logicconvention plugin (build-logic/src/main/kotlin/io.sentry.systemtest.gradle.kts), following the existingio.sentry.spotless/io.sentry.javadocpattern. The plugin auto-detects the packaging task with precedence war → shadowJar → bootJar (mirroringtest/system-test-runner.py) and declares its archive as asystemTestinput + dependency:tasks.matching { it.name == "systemTest" }.configureEach { val archiveTask = when { tasks.findByName("war") != null -> "war" tasks.findByName("shadowJar") != null -> "shadowJar" tasks.findByName("bootJar") != null -> "bootJar" else -> null } if (archiveTask != null) { dependsOn(archiveTask) inputs.files(tasks.named(archiveTask)) .withPropertyName("appArchive") .withNormalizer(ClasspathNormalizer::class.java) } }Each sample just applies
id("io.sentry.systemtest"); the existing inlinesystemTestblocks are otherwise unchanged.configureEachdefers the wiring until the task is realized (noafterEvaluate), at which point the packaging plugins are already applied.💡 Motivation and Context
outputs.upToDateWhen { false }disabled up-to-date checks and build cache reuse for thesystemTesttasks, because the launched JAR/WAR was not modeled as a task input. This models that input properly — in one place — instead of disabling incremental builds wholesale.💚 How did you test it?
./gradlew spotlessApply/spotlessCheckpass (the new plugin compiles and applies)../gradlew --dry-run :sentry-samples:<module>:systemTestfor a console (shadowJar), Spring Boot 2 (shadowJar), Spring Boot 4 (bootJar), and Tomcat (war) module confirms the packaging task is now wired into the task graph ahead ofsystemTest.📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps
#skip-changelog